<template>
  <div class="">
    <button @click="getData">获取数据</button>
    <span>{{ data.testDemoData }}</span>
  </div>
</template>

<script setup>
import { reactive } from 'vue'
import { test } from '~/utils/api/test'
const data = reactive({
    testDemoData: '1'
})
async function getData() {
    let res = await test()
    if(res) {
      data.testDemoData = res.data.name
    }
}

</script>

<style scoped></style>